package com.edu.service.impl;

import com.edu.bean.User;
import com.edu.dao.UserDao;
import com.edu.dao.impl.UserDaoImpl;
import com.edu.service.UserService;

/*
 * @Author:mx
 * @Date:2025/9/19-15:01:25
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();
    @Override
    public int userLogin(String username, String password) {
       User user = userDao.findUserByNameAndPwd(username,password);
       if(user != null){
           return 1;
       }else{
           user = userDao.findUserByName(username);
           if(user != null){
               return -1;
           }
           return 0;
       }
    }
}
